package cn.javastudy.design._3_行为型模式._解释器模式;

import lombok.AllArgsConstructor;

/**
 * 终结符表达式   变量表达式
 *
 * @author sumou
 * @date 2025/01/25
 */
@AllArgsConstructor
public class Variable extends AbstractExpression {

    private String name;


    @Override
    public int interpret(Context context) {
        return context.getValue(this);
    }

    @Override
    public String toString() {
        return name;
    }

}
